-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically focus inputs, or the primary button, in modals. #2974
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
This is cool, but @joel-jeremy is currently refactoring the |
👋 Hi! It looks like this PR has not had any changes for a week now. Would you like someone to review this PR? If so - please remove the "[WIP]" prefix from the PR title. That will let the community know that this PR is open for a review. |
@joel-jeremy Do you have all of the react button refactoring PRs in now? |
@psybers I believe the relevant react aria button PRs are in now, there's one tiny conflict left. |
@matt-fidd Conflicts resolved. |
> | ||
Delete | ||
</Button> | ||
<InitialFocus> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@psybers - I'm not questioning you on this, just a learning moment for me as I get to better grips with React. Why is this one wrapped in instead of an autofocus prop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses the focus()
call on the element, after a short delay. Which is needed in some cases.
Will leave this for a day for any other opinions before I merge it. |
Working so that modals will automatically focus the first input, or for confirmation-style modals, autofocus the "primary" button so you can just hit ENTER when it pops up (or ESC).
There are two React Aria button refactoring PRs remaining. It looks like #2915 has no overlap. This PR should be merged after #3163 as it conflicts on one file: